#include "wx/xrc/xh_kwxlcddisplayhandler.h"
#include "wx/KWIC/LCDWindow.h"

IMPLEMENT_DYNAMIC_CLASS(kwxLCDDisplayHandler, wxXmlResourceHandler)

kwxLCDDisplayHandler::kwxLCDDisplayHandler() {   
    AddWindowStyles();   
}

wxObject *kwxLCDDisplayHandler::DoCreateResource() {
      
    XRC_MAKE_INSTANCE(control, kwxLCDDisplay)
    control->Create(m_parentAsWindow, GetPosition(), GetSize());
    control->SetNumberDigits(GetLong(wxT("num_digits")));
    control->SetValue(GetText(wxT("value")));
    control->SetLightColour(GetColour(wxT("active_colour"), wxColour(0, 255, 0)));
    control->SetGrayColour(GetColour(wxT("inactive_colour"), wxColour(0, 64, 0)));

    SetupWindow(control);

    return control;
}

bool kwxLCDDisplayHandler::CanHandle(wxXmlNode *node) {
   
   
    return IsOfClass(node, wxT("kwxLCDDisplay"));
}
